package com.avic.map.dal.mapper;

import com.avic.map.dal.condition.PageQueryCarResourceListCondition;
import com.avic.map.dal.condition.PageQueryMapCarCondition;
import com.avic.map.dal.model.CarResource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: huangsheng
 * @date: 2018/9/3
 */
@Mapper
public interface CarResourceMapper {

    /**
     * 分页查询列表
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:20
     */
    List<CarResource> itemList(PageQueryCarResourceListCondition pageQueryCarResourceListCondition);

    /**
     * 数据总数
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:20
     */
    int queryRecordsTotal(PageQueryCarResourceListCondition pageQueryCarResourceListCondition);


    /**
     * 新增资源
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:21
     */
    int insert(CarResource carResource);

    /**
     * 根据ID查询信息
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:21
     */
    CarResource queryCarResourceById(int id);

    /**
     * 根据车辆编号查询单兵信息数量
     *
     * @param carNumber 车辆编号
     * @return 数据数量
     */
    int queryItemCountByCarNumber(String carNumber);


    /**
     * 修改资源
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:23
     */
    int update(CarResource carResource);

    /**
     * 删除资源
     *
     * @author: huangsheng
     * @date: 2018/9/3 下午3:24
     */
    int delete(int id);

    List<CarResource> queryAllCar();

    int updateCarState(@Param("carState") int carState, @Param("carNumber") String carNumber);

    List<CarResource> mapCarRecords(PageQueryMapCarCondition pageQueryMapCarCondition);

    int mapCarRecordsTotal(PageQueryMapCarCondition pageQueryMapCarCondition);

    List<CarResource> queryCarTreeRecords();

    int updateCarImagePath(@Param("carImagePath") String carImagePath, @Param("carId") int carId);
}
